package cn.edu.tju.elm.service.Impl;

import cn.edu.tju.elm.model.Cart;
import cn.edu.tju.elm.repository.CartRepository;
import cn.edu.tju.elm.service.CartItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CartItemServiceImpl implements CartItemService {
    @Autowired
    private CartRepository cartRepository;

    @Override
    public List<Cart> getCartItemsByUserId(Long userId) {
        return cartRepository.findByCustomerId(userId);
    }
}
